package cn.bugstack.mybatis.session;

import java.sql.Connection;

/**
 * description: 事物隔离级别枚举
 * taskId：
 * <pre>
 * change history:
 * date             defect#             person                comments
 * ---------------------------------------------------------------------
 * 2024/11/27       ********         zhaochaoyue        create file
 * </pre>
 *
 * @author: zhaochaoyue
 * @date: 2024/11/27 15:14
 * @copyright: 2024
 */
public enum TransactionIsolationLevel {
    //jdbc的5个级别
    NONE(Connection.TRANSACTION_NONE),
    READ_UNCOMMITED(Connection.TRANSACTION_READ_UNCOMMITTED),
    READ_COMMITED(Connection.TRANSACTION_READ_COMMITTED),
    REPEATABLE_READ(Connection.TRANSACTION_REPEATABLE_READ),
    SERIALIZABLE(Connection.TRANSACTION_SERIALIZABLE);
    
    private final int level;

    TransactionIsolationLevel(int level) {
        this.level = level;
    }

    public int getLevel() {
        return level;
    }
}
